<template>
  <!-- 下载文件 -->
  <div class='upLoad'>
    <div class="yyzz" @click="downloadFiles(yyzz.data)">营业执照下载</div>
    <div @click="downloadFiles(qm.data)">签名下载</div>
  </div>
</template>
 
<script setup>
import fileDownload from 'js-file-download';
import qm from './qm.json';       // 签名
import yyzz from './yyzz.json';   // 营业执照
console.log('qm', qm)
console.log('yyzz', yyzz)

function downloadFiles(data) {
  for (let i = 0; i < 30; i++) {
    console.log('data[i].url', data[i].url)
    setTimeout(() => {
      fileDownload(data[i].url, `${data[i].name}.png`);
    }, 5000 * i)
  }
}
</script>
 
<style lang='scss' scoped>
.upLoad {
  div {
    width: 100px;
    height: 50px;
    line-height: 50px;
    border: 1px solid #000;
    margin: 200px auto;
    text-align: center;
  }
}
</style>